package com.jt.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/*
*
* Filter 过滤器
* AuthenticationManager 认证管理器
* AuthenticationProvider 认证服务处理器
* UserDetailsService 负责用户信息的获取及封装
*
* */
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    /*
    * 初始华加密对象
    *
    * */
    @Bean
    public BCryptPasswordEncoder passwordEncoder(){
        return new BCryptPasswordEncoder();
    }

    /*
    * 顶替认证管理器对象
    *
    * */
    @Bean
    @Override
    protected AuthenticationManager authenticationManager() throws Exception {
        return super.authenticationManager();
    }
}
